<?php


namespace app\admin\controller;

use rabbitmq\Amq;

class Rabbit
{

    /*
     * 测试rabbitmq消息生产
     * */
    public function index()
    {
        $data = [
            "action" => "admin/Index/test",
            "ip" => "114.206.154.126",
            "platform" => "h5",
            "uuid" => 2041654564,
            "create_time" => 1564654564
        ];
        $msg = json_encode($data);
        $res = Amq::getInstance()->publisher($msg);
        var_dump($res);die;


        var_dump('hello world1995');die;
    }

    /*
     * 测试rabbitmq消息消费
     * */
    public function consumer()
    {
        $res = Amq::getInstance()->consumer();
        var_dump($res);die;
    }



}